<template>
  <view class="flex justify-between">
    <PsySvg src="/static/detail/show.svg" width="30rpx" :text="showText" />
    <PsySvg
      v-if="isLike"
      @click="likeClick"
      src="/static/detail/like.svg"
      width="30rpx"
      :text="likeText"
    />
    <PsySvg
      v-else
      @click="likeClick"
      src="/static/detail/like-select.svg"
      width="30rpx"
      :text="likeText"
    />
  </view>
</template>

<script>
export default {
  props: {
    showText: {
      type: [Number, String],
      default: 0,
    },
    likeText: {
      type: [Number, String],
      default: 0,
    },
  },
  data() {
    return {
      isLike: true,
    }
  },
  methods: {
    likeClick() {
      this.isLike = !this.isLike
      if (this.isLike) {
        uni.showToast({
          icon: 'none',
          title: '已取消喜欢',
        })
      } else {
        uni.showToast({
          icon: 'none',
          title: '已添加到我的视频库',
        })
      }
    },
  },
}
</script>

<style scoped></style>
